<?php
session_start();
$username = $_POST['username'];
$pw = $_POST['pw'];
include_once "conn.php";
$main = new main();
$result = $main->login($username, $pw);
if ($result){
    $_SESSION['admin']=$username;
}
else{
    session_destroy();
}
echo json_encode($result);